<template>
    <div>
        hello world!
    </div>
</template>

<script>
export default {
  name: 'SseTest',
  mounted () {
    const sseUrl = 'http://localhost:8083/notification/sse_test'
    const sse = new EventSource(sseUrl)
    sse.onopen = function () {
      console.log('sse连接建立')
    }
    sse.onmessage = function (event) {
      console.log(event.data)
      // const notification = JSON.parse(event.data)
      // this.$notify.info({
      //   title: '消息',
      //   message: notification.content
      // })
    }
  }
}
</script>

<style scoped>

</style>
